package cn.dengta.webapp.trade.model;

import cn.dengta.common.model.State;
import cn.dengta.common.model.ValueProxy;
import cn.dengta.context.model.LabelI18nProxy;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

import static cn.dengta.context.model.TradeEnumI18nKey.*;
import static cn.dengta.webapp.trade.model.TradeTypeCore.ADD_ACTIVE;
import static cn.dengta.webapp.trade.model.TradeTypeCore.DEDUCT_ACTIVE;

@Getter
public enum GoldTradeType implements LabelI18nProxy<GoldTradeType, Integer> {
	/** 钻石兑换金币 */
	GOLD_EXCHANGE_COINS(1, TRADE_TYPE_GOLD_EXCHANGE, ADD_ACTIVE),
	/** 管理后台增加 */
//	GOLD_ADMIN_ADD(2, TRADE_TYPE_GOLD_EXCHANGE, ADD_ACTIVE),
	/** 管理后台扣减 */
//	GOLD_ADMIN_DEDUCT(3, TRADE_TYPE_GOLD_EXCHANGE, DEDUCT_ACTIVE),

	/** 游戏消耗 */
	GOLD_FOR_GAME(10, TRADE_TYPE_GOLD_FOR_GAME, DEDUCT_ACTIVE),
	/** 游戏奖励 */
	GOLD_FOR_GAME_REWARD(11, TRADE_TYPE_GOLD_GAME_REWARD, ADD_ACTIVE),

	;
	@EnumValue
	final Integer value;
	final TradeTypeCore from;
	final State state;
	final ValueProxy<GoldTradeType, Integer> proxy;

	GoldTradeType(Integer value, String label, TradeTypeCore from, State state) {
		this.value = value;
		this.from = from;
		this.state = state;
		this.proxy = new ValueProxy<>(this, state, this.value, label);
	}

	GoldTradeType(Integer value, String label, TradeTypeCore from) {
		this(value, label, from, State.PUBLIC);
	}

}
